const info = {
    name:"why",
    friend:{name:"kobe"}
}

const obj = {...info,name:"codewhy"}

obj.friend.name = 'james'
console.log(info)